<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑博客类型</title>
</head>
<lui:context/>
<u:View basePath="/res-datum/blog" userJS="editTreeBlogType" userCSS="editTreeBlogType" delayLoadJs="false" res="jquery.ztree">
<body>
<lui:dialogBody>
    <lui:ajax url="${ctx }/sys/code/findCodeInfoByTypeId" id="findBlogCategoryAjax" data="{'codeTypeId':'blogType'}" 
        contentType="application/x-www-form-urlencoded" onSuccess="EditBlogTypePage.findCategorySucc" autoSend="true"/>
    <lui:ajax url="${ctx }/sys/code/deleteCodeByCodeValue" id="deleteBlogCategoryAjax" type="post" onSuccess="EditBlogTypePage.onDeleteBlogTypeSucc" 
        contentType="application/x-www-form-urlencoded" />
    <lui:ajax url="${ctx }/sys/code/save/treeCode" id="saveTreeCodeInfoAjax" type="post" onSuccess="EditBlogTypePage.onSaveTreeCodeInfoSucc" />
    <div style='margin-left:auto;margin-right:auto;display:table;width:100%;'>
        <div class='t-code-list-panel'>
            <lui:oper-bar items="add,sub,save,refresh" onAdd="EditBlogTypePage.addBlogCategory" onSub="EditBlogTypePage.delBlogCategory"
                onRefresh="EditBlogTypePage.refreshBlogCategory" onSave="EditBlogTypePage.saveBlogType"/>
            <lui:tree nodeTitleKey="codeInfoName" nodeIdKey="id" ajax="findBlogCategoryAjax" id="categoryTree"
                parentIdKey="ext1" dataStructure="array" nodeNameKey="codeInfoName" nodeChildrenKey="children" className="code-list t-menu"
                onCurrentNodeSelected="EditBlogTypePage.onSelected" maxLayer="3" onlyShowFolder="true" drag="move"
                onDrop="EditBlogTypePage.onDrop"/>
        </div>
        <div class='t-code-edit-panel'>
            <form id="editCodeInfoFrm" class="m-cust m-narrow">
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="codeInfoName">名称：</label>
                        </div>
                        <div class="col-xs-8">
                            <input autofocus="autofocus" class='m-input form-control' id='codeInfoName' name='codeInfoName' 
                               onchange="EditBlogTypePage.onValueChanged()"
                               data-validate='true' data-not-empty='true' 
                               data-empty-text="博客类型名称不能为空" maxlength="18">
                        </div>
                    </div>
                </div>
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="codeInfoValue">码值：</label>
                        </div>
                        <div class="col-xs-8">
                            <input class='m-input form-control' id='codeInfoValue' readonly="readonly" name='codeInfoValue'>
                        </div>
                    </div>
                </div>
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="orderNumber">序号：</label>
                        </div>
                        <div class="col-xs-8">
                            <input class='m-input form-control' id='orderNumber' name='orderNumber' type="number" min="0"
                               onchange="EditBlogTypePage.onValueChanged()">
                        </div>
                    </div>
                </div>
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="state">状态：</label>
                        </div>
                        <div class="col-xs-8">
                            <select class='m-input form-control' id='state' name='state' onchange="EditBlogTypePage.onValueChanged()">
                                <option value="1" selected="selected">正常</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                    </div>
                </div>
                <input type='hidden' name='codeType.codeTypeId' value='blogType'>
            </form>
        </div>
    </div>
</lui:dialogBody>
<lui:dialogFooter>
    <button class="btn btn-primary m-btn" type="button" onclick="EditBlogTypePage.saveBlogType()">保存</button>
    <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box" onclick="EditBlogTypePage.closeDialog()">关闭</button>
</lui:dialogFooter>
</body>
</u:View>
</html>